package com.tyk.bookstore.back.system.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyk.bookstore.back.system.model.type.MenuType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 菜单
 */
@Schema(name = "MenuDo", description = "菜单")
@Data
@TableName("menu")
public class MenuDo implements Serializable {

    public static final Long TOP_ID = 0L;

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    @TableId(value = "id")
    private Long id;

    @Schema(description = "父目录ID")
    @TableField("parent_id")
    private Long parentId;

    @Schema(description = "路由名称")
    @TableField("name")
    private String name;

    @Schema(description = "路由路径")
    @TableField("path")
    private String path;

    @Schema(description = "组件路径")
    @TableField("component")
    private String component;

    @Schema(description = "目录路由的重定向地址")
    @TableField("redirect")
    private String redirect;

    @Schema(description = "路由标题")
    @TableField("title")
    private String title;

    @Schema(description = "路由图标")
    @TableField("icon")
    private String icon;

    @Schema(description = "路由类型[0目录,1菜单]")
    @TableField("type")
    private MenuType type;

    @Schema(description = "是否隐藏[0展示,1隐藏]")
    @TableField("hidden")
    private Boolean hidden;

    @Schema(description = "是否缓存[0不缓存,1缓存]")
    @TableField("keep_alive")
    private Boolean keepAlive;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
